import java.time.DayOfWeek;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;

public class MapTest {

    public static void main(String[] args) {
        
        Map<String , Integer> mp = new HashMap<>();
        mp.put("apple",1111);
        mp.put("pear",2222);

        // System.out.println(mp.put("watermelon2", 5555));  // null

        // System.out.println(mp.put("apple", 3333));   //  1111


        // Integer n = mp.get("apple");
        // System.out.println(n);

        // System.out.println("apple".hashCode()); //93029210



        Map<DayOfWeek,String> map = new EnumMap<>(DayOfWeek.class);
        map.put(DayOfWeek.MONDAY, "周一");
        map.put(DayOfWeek.TUESDAY, "周二");
        map.put(DayOfWeek.WEDNESDAY, "周三");
        map.put(DayOfWeek.THURSDAY, "周四");
        map.put(DayOfWeek.FRIDAY, "周五");
        map.put(DayOfWeek.SATURDAY, "周六");
        map.put(DayOfWeek.SUNDAY, "周日");

        // System.out.println(map);

        // for(DayOfWeek ss : map.keySet()){
        //     System.out.println(map.get(ss));
        // }


        Map<String , Integer> tmap = new TreeMap<>();
        tmap.put("axiaoxing", 12);
        tmap.put("cxiaohong", 13);
        tmap.put("bxiaodong", 14);
        tmap.put("dxiaowang", 15);
        System.out.println(tmap);  // {axiaoxing=12, bxiaodong=14, cxiaohong=13, dxiaowang=15}

        // for(String name : tmap.keySet()){
        //     System.out.println( name+"==>"+tmap.get(name));
        // }    


        
    }

}